// 全局配置
window.global_configs = {
    on_work_time: '09:00',
    off_work_time: '18:00',
    work_time: 9
};

window.notifyCounts = {
    totolists: 0,
    messages: 0
};

$(function () {

    $('[data-toggle="tooltip"]').tooltip()

    // 清除消息
    $.post('/messages/cleanMessage', {
        url: location.href.replace (location.hash, "")
    },function (response) {
        if (response.errno) {
            console.log(response.message);
        } else {
            if (response.data.count) {
                $('#message-count').html('<span class="tag tag-danger">' + response.data.count + '</span>');
            } else {
                $('#message-count').html('');
            }
        }
    });

    // 当滚动条大于 200 显示回到顶部按钮
    $(document).scroll(function () {
        if ($(this).scrollTop() > 200) {
            $('#goTop').removeClass('hidden');
        } else {
            $('#goTop').addClass('hidden');
        }
    });

    //点击回到顶部
    $('#goTop').click(function () {
        // alert(1);
        $('html, body').animate({scrollTop: 0}, 'fast');
    });

    // 点击显示二级菜单
    $('#nav .secondary-menu').click(function () {
        var secondary_menu = $(this).next();
        secondary_menu.slideToggle(300);
    });

});







